{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1398
  Verdict: Accepted
}
type   
	circle = record
		x, y, r : longint;
	end;
 
	event = record
		index, x, y, op : longint;
	end;
 
	tnode = record
		index, parent, left, right : longint;
	end;
 
var
 n, i, j, k, r, h, root, kk : longint;
 a : array[0..10010] of circle;
 e : array[0..20010] of event;
 tree : array[0..10010] of tnode;
 
procedure answer(i, j : longint);
begin
 writeln(i, ' ', j);
 halt(0);
end; 
 
procedure sort(l, r : longint);
 
var
 i, j : longint;
 x, y : event;
 
begin
	i := l;
	j := r;
	x := e[l + random(r - l + 1)];
	repeat
		while (e[i].y < x.y) or ((e[i].y = x.y) and (e[i].op < x.op)) do inc(i);
		while (e[j].y > x.y) or ((e[j].y = x.y) and (e[j].op > x.op)) do dec(j);
    if(i<=j)then
		 begin
			y:=e[i];
			e[i]:=e[j];
			e[j]:=y;
			inc(i);
      dec(j);
		 end;
	until i > j;
	if l < j then sort(l, j);
	if i < r then sort(i, r);
end;  
 
function intersect(i, j : longint) : boolean;
 
var
	d : longint;
 
begin
	d := sqr(a[i].x - a[j].x) + sqr(a[i].y - a[j].y);
	intersect := (sqr(a[i].r + a[j].r) >= d) and (sqr(a[i].r - a[j].r) <= d);
end;
 
function insert(index : longint) : longint;
 
var
	tek : longint;
 
begin
	if root = 0 then begin
		inc(h);
		tree[h].index := index;
		insert := h;
		root := h;
		exit;
	end;
	tek := root;
	while not (((a[index].x < a[tree[tek].index].x) and (tree[tek].left = 0)) or
				((a[index].x > a[tree[tek].index].x) and (tree[tek].right = 0)) or
				((a[index].x = a[tree[tek].index].x) and (a[index].y + a[index].r > a[tree[tek].index].x + a[tree[tek].index].r) and
				(tree[tek].right = 0))) do begin
		if (a[index].x = a[tree[tek].index].x) and intersect(index, tree[tek].index) then answer(index, tree[tek].index);
		if (a[index].x < a[tree[tek].index].x) then tek := tree[tek].left else tek := tree[tek].right;
	end;
	if a[index].x < a[tree[tek].index].x then begin
		inc(h);
		tree[h].index := index;
		tree[h].parent := tek;
		tree[tek].left := h;
	end else begin
		inc(h);
		tree[h].index := index;
		tree[h].parent := tek;
		tree[tek].right := h;
	end;
 	insert := h;  
end;
 
function find(index : longint) : longint;
 
var
	tek : longint;
 
begin
	tek := root;
	while tree[tek].index <> index do
		if a[index].x < a[tree[tek].index].x then tek := tree[tek].left else
			tek := tree[tek].right;
	find := tek; 
end;
 
function left_neightbour(node : longint) : longint;
 
var
	tek : longint;
 
begin
	tek := node;
	if (tek = root) and (tree[tek].left = 0) then left_neightbour := 0 else
	if tree[tek].left = 0 then left_neightbour := tree[tek].parent else begin
		tek := tree[tek].left;
		while tree[tek].right <> 0 do tek := tree[tek].right;
		left_neightbour := tek;
	end;
end;
 
function right_neightbour(node : longint) : longint;
 
var
	tek : longint;
 
begin
	tek := node;
	if (tek = root) and (tree[tek].right = 0) then right_neightbour := 0 else
	if tree[tek].right = 0 then right_neightbour := tree[tek].parent else begin
		tek := tree[tek].right;
		while tree[tek].left <> 0 do tek := tree[tek].left;
		right_neightbour := tek;
  end;
end;
 
procedure erase(node : longint);
 
var
	tek : longint;
 
begin
	if (tree[node].left = 0) and (tree[node].right = 0) then begin
		if tree[node].parent <> 0 then begin
			if tree[tree[node].parent].left = node then tree[tree[node].parent].left := 0 else
				tree[tree[node].parent].right := 0;
		end else root := 0;
	end else
	if tree[node].left = 0 then begin
		if node = root then begin
			root := tree[node].right;
			tree[tree[node].right].parent := 0;
		end else begin
			tree[tree[node].right].parent := tree[node].parent;
			if tree[tree[node].parent].left = node then tree[tree[node].parent].left := tree[node].right else
				tree[tree[node].parent].right := tree[node].right;
		end;
	end else
	if tree[node].right = 0 then begin
		if node = root then begin
			root := tree[node].left;
			tree[tree[node].left].parent := 0;
		end else begin
			tree[tree[node].left].parent := tree[node].parent;
			if tree[tree[node].parent].left = node then tree[tree[node].parent].left := tree[node].left else
				tree[tree[node].parent].right	:= tree[node].left;
		end;
	end else begin
	 tek := right_neightbour(node);
	 tree[node].index := tree[tek].index;
   erase(tek);
  end;
end;
 
begin
	randseed := 8753;
	reset(input, 'input.txt');
	rewrite(output, 'output.txt');
	read(n);
	for i:=1 to n do
		read(a[i].x, a[i].y, a[i].r);
	for i := 1 to n do begin
		kk := 2 * i - 1;
		e[kk].index := i;
		e[kk].y := a[i].y - a[i].r;
		e[kk].op := 0;
		inc(kk);
		e[kk].index := i;
		e[kk].y := a[i].y + a[i].r;
		e[kk].op := 1;
	end;
	kk := 2 * n;
	sort(1, kk);
	fillchar(tree, sizeof(tree), 0);
	h := 0;
	root := 0;
	for i := 1 to kk do
		if e[i].op = 0 then begin
			j := insert(e[i].index);
			k	:= left_neightbour(j);
			if (k <> 0) and intersect(e[i].index, tree[k].index) then answer(e[i].index, tree[k].index);
			k := right_neightbour(j);
			if (k <> 0) and intersect(e[i].index, tree[k].index) then answer(e[i].index,tree[k].index);
		end else begin
			r := find(e[i].index);
			j := left_neightbour(r);
			if j <> 0 then j := tree[j].index;
			k := right_neightbour(r);
			if k <> 0 then k := tree[k].index;
			erase(r);
			if (j <> 0) and (k <> 0) and (j <> k) and intersect(j, k)then answer(j, k);
		end;
 	write(0);  
end.